package we3d.loader 
{
	import we3d.loader.LWOLoader;
	import we3d.loader.OBJLoader;
	import we3d.loader._3DSLoader;
	
	/**
	* Choose the correct loader by the file extension
	*/
	public class FileLoader
	{
		public var loader:SceneLoader;
		public var type:String="";
		
		public function FileLoader (filename:String="") {
			if(filename != "") {
				var e:int = filename.lastIndexOf(".");
				
				if(e==-1) {
					
					// TODO: Load file and choose format before parsing
					
				}else{
					
					var type:String = filename.substring(e+1, filename.length).toUpperCase();
					
					switch(type) {
						
						case "LWO":
							loader = new LWOLoader();
							break;
						case "OBJ":
							loader = new OBJLoader();
							break;
						case "3DS":
							loader = new _3DSLoader();
							break;
					}
					
				}
			}
		}
		
	}
	
}